<%@ page import="org.apache.commons.lang3.StringUtils" %><%--
  Created by IntelliJ IDEA.
  User: lzy
  Date: 2018/8/15
  Time: 19:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>doLogin</title>
</head>
<body>
<%
    // 1.获取用户登陆信息
    String username = request.getParameter("db.username");

    // 2.若登陆信息完整，则吧登陆信息放入httpSession中
    if (!StringUtils.isEmpty(username)) {
        String sessionKey = application.getInitParameter("userSessionKey");
        session.setAttribute(sessionKey, username);
        // 3. 重定向到list.jsp
        response.sendRedirect(request.getContextPath() + "/login/list.jsp");
    } else {
        response.sendRedirect(request.getContextPath() + "/login/login.jsp");
    }
%>
</body>
</html>
